import {bannerlist} from '../../../request/api'
const state = {
    bannerList:[]
}
const getters = {
    getBannerList(state){
        return state.bannerList
    }
}
const mutations = {
    REQ_BANNERLIST(state,payload){
        state.bannerList = payload
    }
}
const actions = {
    changeBannerAction({commit}){
        bannerlist().then((res)=>{
            if(res.data.code==200){
                let list = res.data.list?res.data.list:[];
                commit('REQ_BANNERLIST',list)
            }
        })
    }
}
export default {
    state,
    getters,
    mutations,
    actions,
    // 开启命名空间
    namespaced:true,
}